<html>
<head><meta charset="utf-8"><title>Datalog, Polonius, Chalk? · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Datalog.2C.20Polonius.2C.20Chalk.3F.html">Datalog, Polonius, Chalk?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="213612127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Datalog%2C%20Polonius%2C%20Chalk%3F/near/213612127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Datalog.2C.20Polonius.2C.20Chalk.3F.html#213612127">(Oct 16 2020 at 20:46)</a>:</h4>
<p>So this super-feels-like-a-dumb-question but... I notice there are mentions of Datalog re: both Polonius and Chalk, and some mentions of not adhering strictly to that model, and that's fine, but I noticed... if these are both Datalog-esque, and rustc is query-driven already, is there any reason we don't have a single unified logic database model for the compiler?</p>
<p>is it "oh yeah, that's totally what we're aiming for, it's just a huge project to implement!"<br>
or "no these are actually far more unrelated because..."</p>



<a name="213617306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Datalog%2C%20Polonius%2C%20Chalk%3F/near/213617306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Datalog.2C.20Polonius.2C.20Chalk.3F.html#213617306">(Oct 16 2020 at 21:38)</a>:</h4>
<p>"These are both Datalog-esque" is about where the similarities end for Chalk and Polonius.</p>
<ul>
<li>Chalk evaluates predicates on-demand, Polonius evaluates everything eagerly.</li>
<li>Chalk has to handle coinductive cycles, Polonius doesn't.</li>
<li>Chalk uses a cache for speed reasons, Polonius has to throw away all it's state once borrow checking the current function has finished for memory reasons and has no use for a cache anyway.</li>
<li>Chalk has clauses generated on-demand, Polonius knows all clauses at (rustc) compile time.</li>
</ul>



<a name="213619264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Datalog%2C%20Polonius%2C%20Chalk%3F/near/213619264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Datalog.2C.20Polonius.2C.20Chalk.3F.html#213619264">(Oct 16 2020 at 22:02)</a>:</h4>
<p>Alright. I had inferred incorrectly what "Datalog-esque" meant then in terms of structure!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>